<template>
  <div class="custom-v-model">
    <!-- 例如：vue 颜色选择 -->
    <input
      type="text"
      :value="childVal"
      @input="$emit('change', $event.target.value)"
    />
    <hr />
    <button @click="$emit('change', '点击button传入父组件的值')">click</button>
  </div>
</template>

<script>
export default {
  model: {
    prop: 'childVal',
    event: 'change'
  },
  props: ['childVal']
}
</script>
